3.86 \(\int x^2 \cos (a+b \log (c x^n)) \, dx\)

Optimal. Leaf size=56 \[ \frac{b n x^3 \sin \left (a+b \log \left (c x^n\right )\right )}{b^2 n^2+9}+\frac{3 x^3 \cos \left (a+b \log \left (c x^n\right )\right )}{b^2 n^2+9} \]

[Out]

(3*x^3*Cos[a + b*Log[c*x^n]])/(9 + b^2*n^2) + (b*n*x^3*Sin[a + b*Log[c*x^n]])/(9 + b^2*n^2)

________________________________________________________________________________________

Rubi [A]  time = 0.0175289, antiderivative size = 56, normalized size of antiderivative = 1., number of steps used = 1, number of rules used = 1, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.067, Rules used = {4486} \[ \frac{b n x^3 \sin \left (a+b \log \left (c x^n\right )\right )}{b^2 n^2+9}+\frac{3 x^3 \cos \left (a+b \log \left (c x^n\right )\right )}{b^2 n^2+9} \]

Antiderivative was successfully verified.

[In]

Int[x^2*Cos[a + b*Log[c*x^n]],x]

[Out]

(3*x^3*Cos[a + b*Log[c*x^n]])/(9 + b^2*n^2) + (b*n*x^3*Sin[a + b*Log[c*x^n]])/(9 + b^2*n^2)

Rule 4486

Int[Cos[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*(d_.)]*((e_.)*(x_))^(m_.), x_Symbol] :> Simp[((m + 1)*(e*x)^(m +
 1)*Cos[d*(a + b*Log[c*x^n])])/(b^2*d^2*e*n^2 + e*(m + 1)^2), x] + Simp[(b*d*n*(e*x)^(m + 1)*Sin[d*(a + b*Log[
c*x^n])])/(b^2*d^2*e*n^2 + e*(m + 1)^2), x] /; FreeQ[{a, b, c, d, e, m, n}, x] && NeQ[b^2*d^2*n^2 + (m + 1)^2,
 0]

Rubi steps

\begin{align*} \int x^2 \cos \left (a+b \log \left (c x^n\right )\right ) \, dx &=\frac{3 x^3 \cos \left (a+b \log \left (c x^n\right )\right )}{9+b^2 n^2}+\frac{b n x^3 \sin \left (a+b \log \left (c x^n\right )\right )}{9+b^2 n^2}\\ \end{align*}

Mathematica [A]  time = 0.0721208, size = 43, normalized size = 0.77 \[ \frac{x^3 \left (b n \sin \left (a+b \log \left (c x^n\right )\right )+3 \cos \left (a+b \log \left (c x^n\right )\right )\right )}{b^2 n^2+9} \]

Antiderivative was successfully verified.

[In]

Integrate[x^2*Cos[a + b*Log[c*x^n]],x]

[Out]

(x^3*(3*Cos[a + b*Log[c*x^n]] + b*n*Sin[a + b*Log[c*x^n]]))/(9 + b^2*n^2)

________________________________________________________________________________________

Maple [F]  time = 0.039, size = 0, normalized size = 0. \begin{align*} \int{x}^{2}\cos \left ( a+b\ln \left ( c{x}^{n} \right ) \right ) \, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*cos(a+b*ln(c*x^n)),x)

[Out]

int(x^2*cos(a+b*ln(c*x^n)),x)

________________________________________________________________________________________

Maxima [B]  time = 1.05383, size = 294, normalized size = 5.25 \begin{align*} \frac{{\left ({\left (b \cos \left (b \log \left (c\right )\right ) \sin \left (2 \, b \log \left (c\right )\right ) - b \cos \left (2 \, b \log \left (c\right )\right ) \sin \left (b \log \left (c\right )\right ) + b \sin \left (b \log \left (c\right )\right )\right )} n + 3 \, \cos \left (2 \, b \log \left (c\right )\right ) \cos \left (b \log \left (c\right )\right ) + 3 \, \sin \left (2 \, b \log \left (c\right )\right ) \sin \left (b \log \left (c\right )\right ) + 3 \, \cos \left (b \log \left (c\right )\right )\right )} x^{3} \cos \left (b \log \left (x^{n}\right ) + a\right ) +{\left ({\left (b \cos \left (2 \, b \log \left (c\right )\right ) \cos \left (b \log \left (c\right )\right ) + b \sin \left (2 \, b \log \left (c\right )\right ) \sin \left (b \log \left (c\right )\right ) + b \cos \left (b \log \left (c\right )\right )\right )} n - 3 \, \cos \left (b \log \left (c\right )\right ) \sin \left (2 \, b \log \left (c\right )\right ) + 3 \, \cos \left (2 \, b \log \left (c\right )\right ) \sin \left (b \log \left (c\right )\right ) - 3 \, \sin \left (b \log \left (c\right )\right )\right )} x^{3} \sin \left (b \log \left (x^{n}\right ) + a\right )}{2 \,{\left ({\left (b^{2} \cos \left (b \log \left (c\right )\right )^{2} + b^{2} \sin \left (b \log \left (c\right )\right )^{2}\right )} n^{2} + 9 \, \cos \left (b \log \left (c\right )\right )^{2} + 9 \, \sin \left (b \log \left (c\right )\right )^{2}\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*cos(a+b*log(c*x^n)),x, algorithm="maxima")

[Out]

1/2*(((b*cos(b*log(c))*sin(2*b*log(c)) - b*cos(2*b*log(c))*sin(b*log(c)) + b*sin(b*log(c)))*n + 3*cos(2*b*log(
c))*cos(b*log(c)) + 3*sin(2*b*log(c))*sin(b*log(c)) + 3*cos(b*log(c)))*x^3*cos(b*log(x^n) + a) + ((b*cos(2*b*l
og(c))*cos(b*log(c)) + b*sin(2*b*log(c))*sin(b*log(c)) + b*cos(b*log(c)))*n - 3*cos(b*log(c))*sin(2*b*log(c))
+ 3*cos(2*b*log(c))*sin(b*log(c)) - 3*sin(b*log(c)))*x^3*sin(b*log(x^n) + a))/((b^2*cos(b*log(c))^2 + b^2*sin(
b*log(c))^2)*n^2 + 9*cos(b*log(c))^2 + 9*sin(b*log(c))^2)

________________________________________________________________________________________

Fricas [A]  time = 0.495998, size = 128, normalized size = 2.29 \begin{align*} \frac{b n x^{3} \sin \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right ) + 3 \, x^{3} \cos \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )}{b^{2} n^{2} + 9} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*cos(a+b*log(c*x^n)),x, algorithm="fricas")

[Out]

(b*n*x^3*sin(b*n*log(x) + b*log(c) + a) + 3*x^3*cos(b*n*log(x) + b*log(c) + a))/(b^2*n^2 + 9)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**2*cos(a+b*ln(c*x**n)),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.30412, size = 1246, normalized size = 22.25 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*cos(a+b*log(c*x^n)),x, algorithm="giac")

[Out]

-1/2*(2*b*n*x^3*e^(1/2*pi*b*n*sgn(x) - 1/2*pi*b*n + 1/2*pi*b*sgn(c) - 1/2*pi*b)*tan(1/2*b*n*log(abs(x)) + 1/2*
b*log(abs(c)))^2*tan(1/2*a) + 2*b*n*x^3*e^(-1/2*pi*b*n*sgn(x) + 1/2*pi*b*n - 1/2*pi*b*sgn(c) + 1/2*pi*b)*tan(1
/2*b*n*log(abs(x)) + 1/2*b*log(abs(c)))^2*tan(1/2*a) + 2*b*n*x^3*e^(1/2*pi*b*n*sgn(x) - 1/2*pi*b*n + 1/2*pi*b*
sgn(c) - 1/2*pi*b)*tan(1/2*b*n*log(abs(x)) + 1/2*b*log(abs(c)))*tan(1/2*a)^2 + 2*b*n*x^3*e^(-1/2*pi*b*n*sgn(x)
 + 1/2*pi*b*n - 1/2*pi*b*sgn(c) + 1/2*pi*b)*tan(1/2*b*n*log(abs(x)) + 1/2*b*log(abs(c)))*tan(1/2*a)^2 - 3*x^3*
e^(1/2*pi*b*n*sgn(x) - 1/2*pi*b*n + 1/2*pi*b*sgn(c) - 1/2*pi*b)*tan(1/2*b*n*log(abs(x)) + 1/2*b*log(abs(c)))^2
*tan(1/2*a)^2 - 3*x^3*e^(-1/2*pi*b*n*sgn(x) + 1/2*pi*b*n - 1/2*pi*b*sgn(c) + 1/2*pi*b)*tan(1/2*b*n*log(abs(x))
 + 1/2*b*log(abs(c)))^2*tan(1/2*a)^2 - 2*b*n*x^3*e^(1/2*pi*b*n*sgn(x) - 1/2*pi*b*n + 1/2*pi*b*sgn(c) - 1/2*pi*
b)*tan(1/2*b*n*log(abs(x)) + 1/2*b*log(abs(c))) - 2*b*n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b^2*n^2*tan(1/2*b*n*log(abs(x)) + 1/2*b*log(abs(c
)))^2*tan(1/2*a)^2 + b^2*n^2*tan(1/2*b*n*log(abs(x)) + 1/2*b*log(abs(c)))^2 + b^2*n^2*tan(1/2*a)^2 + b^2*n^2 +
 9*tan(1/2*b*n*log(abs(x)) + 1/2*b*log(abs(c)))^2*tan(1/2*a)^2 + 9*tan(1/2*b*n*log(abs(x)) + 1/2*b*log(abs(c))
)^2 + 9*tan(1/2*a)^2 + 9)